package com.shuoyue.ycgk.views.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.shuoyue.ycgk.R;


/**
 * 提示框Dialog
 * Created by Forty'7 on 2019/8/17
 */

public class BigImgDialog extends Dialog {
    private Context mContext;
    ImageView bgi;

    public BigImgDialog(@NonNull Context context) {
        super(context, R.style.dialog);
        this.mContext = context;
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_big_img);
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        getWindow().getDecorView().setPadding(0, 0, 0, 0);

        bgi = findViewById(R.id.bigimg);
        bgi.setOnClickListener(v -> dismiss());
    }


    public void setImage(String path) {
        Glide.with(mContext).load(path).placeholder(R.mipmap.img_loading_gray).into(bgi);
    }

}
